KitePlayerMediaSession

class KitePlayerMediaSession(player: KitePlayer, session: JsAny? = navigatorMediaSession(), skipInterval: Duration = 15.seconds) : AutoCloseable

Mirrors player into the browser's media session and routes its buttons back.

That session is what the operating system's media overlay, the keyboard's media keys and a headset read for a page. Browsers show it only while the page plays sound through an audio or video element. KitePlayer plays through Web Audio, which no browser counts today, so the overlay appears only if the page also plays through such an element.

Artwork is a URL here, because that is the only form a browser takes. The item's own cover shows when the page sets none, from a URL made for its bytes (#425). Close it with the player. A button press that arrives after the player closed does nothing.

Parameters

skipInterval

how far the skip back and skip forward actions move when the browser names no offset of its own. Positive.

Constructors

Link copied to clipboard
constructor(player: KitePlayer, session: JsAny? = navigatorMediaSession(), skipInterval: Duration = 15.seconds)

Properties

Link copied to clipboard

False when this browser has no media session. Nothing is mirrored then.

Link copied to clipboard
val platformToken: Any? = null

The browser has no token to hand out. Always null.

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard
fun setArtwork(url: String?)

The picture the overlay shows, as a URL the page can serve. Null removes it.